//
//  SleepTemperatureModel.swift
//  DaRings
//
//  Created by 尹琼 on 2023/2/10.
//

import UIKit

public struct SleepTemperatureModel {
    
    /// 是否只有一天
    public var dataNumber: SleepTemperatureDataNumber
    
    /// 图表数据
    public var barModels: [BarModel]
    
    /// 是否需要设置最大最小值
    public var isSetChartMaxMinAble: Bool
    
    /// 图表最大值
    public var chartMax: Double
    
    /// 图表最小值
    public var chartMin: Double
    
    /// Y轴个数
    public var chartYAixCount: Int = 5
    
    /// 今日温差显示
    public var todayTemperatureDiffText: String
    
    
    
    public init(dataNumber: SleepTemperatureDataNumber,
                barModels: [BarModel],
                isSetChartMaxMinAble: Bool,
                chartMax: Double,
                chartMin: Double,
                todayTemperatureDiffText: String) {
        
        self.dataNumber = dataNumber
        self.barModels = barModels
        self.isSetChartMaxMinAble = isSetChartMaxMinAble
        self.chartMax = chartMax
        self.chartMin = chartMin
        self.todayTemperatureDiffText = todayTemperatureDiffText
    }
    
}



extension SleepTemperatureModel {

    public struct BarModel {
        
        /// 是否是第一天
        public var firstDay: Bool
        
        /// 实际温差
        public var temperatureDiff: Double
        
        /// 图表显示
        public var chartTuples: (low: Double, high: Double)
        
    
        
    }
    
    /// 数据数量
   public enum SleepTemperatureDataNumber {
        
        /// 0个
        case zero
        
        /// 1个
        case one
        
        /// 多个
        case more
        
    }
    
}
